from faker import Faker
from faker.providers import BaseProvider


# 自定义 Provider
class CustomProvider(BaseProvider):

    def custom_type(self):
        """
        自定义数据类型
        """
        return "Custom Data"


# 注册自定义 Provider
fake = Faker()
fake.add_provider(CustomProvider)

# 为自定义 Provider 生成虚拟数据
for _ in range(5):
    custom = fake.custom_type()
    print(f"Custom: {custom}")
